﻿@model IEnumerable<HQPad.Models.Skill>

@{
    ViewBag.Title = "Skills";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    int rulesId = (int) ViewBag.RuleSetID;
}

@section PageScripts {
}

<h1>Skills</h1>

<section class="content">
    <p>@Html.ActionLink("Create new skill", "Create", new { ruleSetId = rulesId }, new { @class="button" })</p>
    <table>
        <tr>
            <th>
                Rules
            </th>
            <th>
                Name
            </th>
            <th>
                Deleted
            </th>
            <th>
                LastUpdated
            </th>
            <th>
                LastUpdatedByUserID
            </th>
            <th></th>
        </tr>

    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Rules.MajorVersion).@Html.DisplayFor(modelItem => item.Rules.MinorVersion)
            </td>
            <td>
                @Html.ActionLink(Html.DisplayFor(modelItem => item.Name).ToString(), "Edit", new { slug = item.Slug.ToLower() })
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Deleted)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastUpdated)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastUpdatedByUserID)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { ruleSetId = item.RuleSetID, slug=item.Slug.ToLower() }) |
                @Html.ActionLink("Delete", "Delete", new { ruleSetId = item.RuleSetID, slug = item.Slug.ToLower() })
            </td>
        </tr>
    }

    </table>
</section>
